function promise (url,method,data,headerType){
	return new Promise((resolve,reject)=>{
		uni.request({
			url,
			method,
			data,
			header: !url.match('/app/user/login')&&!url.match('/app/bus/wxIndex')&&!url.match('/app/bus/dictType')&&!url.match('/app/bus/saveMain')?(headerType?{
			      "content-type":"application/x-www-form-urlencoded",
				  'Authorization': 'Bearer '+ uni.getStorageSync('token')
			    }:{
					'Authorization': 'Bearer '+ uni.getStorageSync('token')
				}):(url.match('/app/bus/saveMain')?{}:{
			      "content-type":"application/x-www-form-urlencoded"
			    }),
			success: res => {
				resolve(res.data)
				if(res.data.code == 401){
					uni.reLaunch({
						url:'/pages/index/login'
					})
				}
			},
			fail: () => {
				uni.showToast({
					title: '请检查网络',
					duration:2000,
					icon:'none'
				});
				resolve({code:500})
			}
		});
	})
}
export default promise